#!/bin/bash

set -e

pushd cargo
#rm -vrf ./target/  #this will cause a lot of redownloading/recompiling... which is otherwise skipped via the git clean below because it's seen as a repository
git clean -dfx
git reset --hard
time git pull

#XXX: don't need rust-installer / rust nightly
#time git submodule update --init
#time python -B src/etc/install-deps.py
time git submodule deinit .

#patch -Np1 -i ../local_rust_libfix.patch
#patch -Np1 -i ../llvm_only_x86_64.patch
popd
./conf

